package com.clw.classpath;

import com.clw.utils.FileUtil;
import java.io.IOException;

/**
 * Created by chengliwei on 2018/12/14.
 */
public class DirEntry implements Entry {

    private String absDir;

    public DirEntry(String absDir) {
        this.absDir = absDir;
    }

    @Override
    public byte[] readClass(String className) throws IOException {
        if(absDir.equals(".")){
            absDir = "";
        }
        String filePath = absDir + className;
        return FileUtil.read(filePath);
    }
}
